package com.woniuxy.controller;

import com.woniuxy.entity.RbacRoleMenuDTO;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.RbacRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rbacRole")
public class RbacRoleController {
    @Autowired
    RbacRoleService rbacRoleService;

    @GetMapping("/findAll/{currentPage}/{pageSize}")
    public ResponseEntity findAll(@PathVariable int currentPage, @PathVariable int pageSize) {
        return rbacRoleService.findAll(currentPage, pageSize);
    }

    @GetMapping("/checked/{roleId}")
    public ResponseEntity checkedRole(@PathVariable int roleId) {
        return rbacRoleService.checkedRole(roleId);
    }

    @PostMapping("/schangeMenus")
    public ResponseEntity changeMenus(@RequestBody RbacRoleMenuDTO rbacRoleMenuDTO) {
        return rbacRoleService.changeMenus(rbacRoleMenuDTO);
    }


}
